<ul class="list-group">
	<li class="list-group-item">
		<h4 class="list-group-item-heading">
			报名中的小伙伴
			<!--@if(canJoin){-->
			<a class="btn-member-apply text-prymary pull-right" href="javascript:;">
				<span class="glyphicon glyphicon-plus"></span>
			</a>
			<!--@}-->
		</h4>
	</li>
	<!--@for(member in applyList){-->
	<li class="list-group-item">
		<div class=" row">
			<!--@if(isCreater){-->
				<div class="col-xs-12">
					<div class="media">
						<div class="media-left">
							<img src="${member.user.avatarUrl}" class="avatar-lg img-rounded">
						</div>
						<div class="media-body">
							<p>${member.user.html}</p>
							<p class="text-muted">${member.applyTime,prettyTime}报名</p>
							<p><a href="javascript:;" class="btn-member-pass text-success" data-id="${member.id}">通过报名申请</a></p>
						</div>
					</div>
				</div>
			<!--@}else{-->
			<div class="col-xs-6 col-sm-4 col-md-3">
				<img src="${member.user.avatarUrl}" class="center-block img-responsive img-rounded">
				<p class="text-ellipsis text-center">${member.user.html}</p>
			</div>
			<!--@}-->
		</div>
	</li>
	<!--@}elsefor{-->
	<li class="list-group-item text-center">无</li>
	<!--@}-->
</ul>
<ul class="list-group">
	<li class="list-group-item">
		<h4 class="list-group-item-heading">报名成功的小伙伴</h4>
	</li>
	<!--@for(member in activeList){-->
	<li class="list-group-item">
		<div class="row">
			<!--@if(isCreater){-->
				<div class="col-xs-12">
					<div class="media">
						<div class="media-left">
							<img src="${member.user.avatarUrl}" class="avatar-lg">
						</div>
						<div class="media-body">
							<p>${member.user.html}</p>
							<p class="text-muted">${member.joinTime,prettyTime}加入</p>
							<p><a href="javascript:;" class="btn-member-delete text-danger" data-id="${member.id}">移除此人</a></p>
						</div>
					</div>
				</div>
			<!--@}else{-->
			<div class="col-xs-6 col-sm-4 col-md-3">
				<img src="${member.user.avatarUrl}" class="center-block img-responsive">
				<p class="text-ellipsis">${member.user.html}</p>
			</div>
			<!--@}-->
		</div>
	</li>
	<!--@}elsefor{-->
	<li class="list-group-item text-center">无</li>
	<!--@}-->
</ul>
<script>
	$(".btn-member-apply").click(function(){
		if(!confirm("确定要报名参加活动吗？")){
			return;
		}
		$.getJSON("/activity/member/apply/${activity.id}",function(json){
			if(!json.ok){
				alert(json.msg);
				return;
			}else{
				loadMemberData();				
			}
		});
	});
	$(".btn-member-pass").click(function(){
		if(!confirm("确定要通过小伙伴的报名申请吗？")){
			return;
		}
		$.getJSON("/activity/member/pass/"+$(this).data("id"),function(json){
			if(!json.ok){
				alert(json.msg);
				return;
			}else{
				loadMemberData();				
			}
		});
	});
	$(".btn-member-delete").click(function(){
		if(!confirm("确定要将小伙伴移除吗？")){
			return;
		}
		$.getJSON("/activity/member/delete/"+$(this).data("id"),function(json){
			if(!json.ok){
				alert(json.msg);
				return;
			}else{
				loadMemberData();				
			}
		});
	});
	
</script>